﻿<UserControl x:Class="Framework.UI.TestHarness.Views.PopupsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:params="http://schemas.codeplex.com/elysium/params"
             xmlns:extra="http://schemas.extra.com/ui"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <StackPanel>
        <TextBlock Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                   Style="{StaticResource HeaderTextStyle}" 
                   Text="Guidelines"/>
        <TextBlock Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                   Style="{StaticResource NormalTextStyle}" 
                   Text="Avoid using Popups, it is difficult to get them to open and close consistently (You have to use code behind, otherwise the popup sticks and stays open). Use windows instead but if you really need to use one, here is how."/>
        <Button x:Name="OpenPopupButton"
                Click="OnOpenPopupClick" 
                Content="Open Popup"
                Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"/>
        <Popup x:Name="Popup"
               AllowsTransparency="True"
               PlacementTarget="{Binding ElementName=OpenPopupButton}"
               StaysOpen="False">
            <extra:CalloutContentControl>
                <TextBlock Margin="{Binding RelativeSource={RelativeSource Self}, Path=(params:General.BoldPadding), Mode=OneWay}"
                           Style="{StaticResource HeaderTextStyle}" 
                           Text="Popup content"/>
            </extra:CalloutContentControl>
        </Popup>
    </StackPanel>
</UserControl>
